﻿@using Microsoft.AspNet.Identity
@model PaPaPa.Web.Models.Datings.DatingInfoViewModel
@{
    ViewBag.Title = "创建约会信息";
    var returnUrl = Request.QueryString["returnUrl"] ?? Request.RawUrl;
    Layout = "~/Areas/Basic/Views/Shared/_Layout.cshtml";
}

@*<h2>@ViewBag.Title</h2>*@

<div class="portlet light">
    <div class="portlet-title">
        <div class="caption"><i class="glyphicon glyphicon-plus color-green-sharp"></i> <span class="color-green-sharp">创建约会信息</span></div>
    </div>
    @if (Request.IsAuthenticated)
    {
        using (Html.BeginForm("Create", "DatingInfo", FormMethod.Post))
        {
            @Html.AntiForgeryToken()

            <div class="form-horizontal">
                @if (!string.IsNullOrWhiteSpace(ViewBag.StatusMessage))
                {
                    <div class="alert alert-success" role="alert">@ViewBag.StatusMessage</div>
                }
                @Html.ValidationSummary(true)

                <div class="form-group">
                    @Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.Name)
                    </div>
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.DatingTime, new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.TextBoxFor(model => model.DatingTime, new { @class = "form-control Wdate", onfocus = "WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" })
                        @Html.ValidationMessageFor(model => model.DatingTime)
                    </div>
                </div>
                <!-- todo 暂时因没有设计邀约环节屏蔽此处代码
                <hr />
                <div class="form-group">
                    @Html.LabelFor(model => model.InviteUser, new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.TextBoxFor(model => model.InviteUser, new { @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.InviteUser)
                    </div>
                </div>
                -->
                <div class="form-group">
                    @Html.LabelFor(model => model.Address, new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.TextBoxFor(model => model.Address, new { @class = "form-control" })
                        @Html.ValidationMessageFor(model => model.Address)
                    </div>
                </div>
                <div class="form-group">
                    @Html.LabelFor(model => model.Description, new { @class = "control-label col-md-2" })
                    <div class="col-md-10">
                        @Html.TextAreaFor(model => model.Description, new { @class = "form-control", Rows = 3 })
                        @Html.ValidationMessageFor(model => model.Description)
                    </div>
                </div>
                <hr />
                <div class="form-group">
                    <div class="col-md-offset-2 col-md-10">
                        <input type="submit" value="保存" class="btn btn-primary" />
                    </div>
                </div>
            </div>
        }

        <!--
        <div>
            @Html.ActionLink("Back to List", "Index")
        </div>
        -->
        @section Scripts {
            @Scripts.Render("~/bundles/jqueryval")
            @Scripts.Render("~/bundles/WdatePicker")
        }
    }
    else
    {
        <p>请先<a href="/User/Account/Login?returnUrl=@returnUrl">登录。</a></p>
    }
</div>
